package cn.tedu.charging.account.dao.persist.repository.impl;

import cn.tedu.charging.account.dao.persist.mappers.ChargingDeviceMapper;
import cn.tedu.charging.account.dao.persist.repository.IChargingDeviceRepository;
import cn.tedu.charging.account.pojo.entity.ChargingDevice;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * 处理充电枪数据的存储库实现类
 */
@Slf4j
@Repository
public class ChargingDeviceRepositoryImpl implements IChargingDeviceRepository {

    @Autowired
    private ChargingDeviceMapper mapper;

    @Override
    public List<ChargingDevice> selectList(Collection<Long> ids) {
        log.debug("开始获取所有充电站的信息");
        QueryWrapper<ChargingDevice> wrapper = new QueryWrapper<>();
        wrapper.eq("station_id", ids);
        return mapper.selectList(wrapper);
    }

}
